load("@rules_cc//cc:defs.bzl", "cc_library")
load("//:gen_test_targets.bzl", "gen_test_targets")

cc_library(
    name = "boost.container",
    srcs = glob(
        [
            "src/*.cpp",
            "src/*.c",
        ],
        exclude = [
            "src/dlmalloc_ext_2_8_6.c",
            "src/dlmalloc_2_8_6.c",
        ],
    ),
    hdrs = glob(
        [
            "include/**/*.hpp",
            "include/**/*.h",
        ],
        exclude = [
            "include/boost/container/detail/**/*.hpp",
            "include/boost/container/node_allocator.hpp",
        ],
    ),
    features = ["parse_headers"],
    includes = ["include"],
    textual_hdrs = glob(
        ["include/boost/container/detail/**/*.hpp"],
    ) + [
        "include/boost/container/node_allocator.hpp",
        "src/dlmalloc_ext_2_8_6.c",
        "src/dlmalloc_2_8_6.c",
    ],
    visibility = ["//visibility:public"],
    deps = [
        "@boost.assert",
        "@boost.config",
        "@boost.intrusive",
        "@boost.move",
    ],
)

gen_test_targets(
    name = "gen_boost.container_test_targets",
    cc_srcs = glob(
        ["test/*_test.cpp"],
        # These tests rely on test/iterator_test.hpp from boost.intrusive, which
        # currently is not included in the boost.inclusive cc_library target in
        # the BCR.
        exclude = [
            "test/list_test.cpp",
            "test/static_vector_test.cpp",
            "test/flat_set_test.cpp",
            "test/map_test.cpp",
            "test/set_test.cpp",
            "test/deque_test.cpp",
            "test/string_test.cpp",
            "test/devector_test.cpp",
            "test/stable_vector_test.cpp",
            "test/slist_test.cpp",
            "test/small_vector_test.cpp",
            "test/vector_test.cpp",
            "test/flat_map_test.cpp",
        ],
    ),
    header_srcs = glob(["test/*.hpp"]),
)
